import React, { useState, useReducer } from 'react';
import useMyReducer from './useMyreducer'


const useDemo = () => {

  // const [state, dispatch] = useMyReducer(reducer, { count: 0 })

  // // const [state, dispatch] = useReducer(reducer, { count: 0 })

  // console.log(state, 'state-----state')
  return <div>
    {/* <button onClick={() => {
      dispatch({ type: 'addCount' })
    }}>加加</button>
    <button onClick={() => {
      dispatch({ type: 'removeCount' })
    }}>减减</button>

    <h1>{state.count}</h1> */}

  </div>
}

export default useDemo;




/**
 * 排序：
 *
 * useState：
 * useReducer：
 *
 * 自定义hooks去封装redux
 *
 */


/***
 * redux 数据状态管理 -> 多方的数据
 *
 * React.createContext()
 *
 * useContext()
 *
 */